# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=khc
pkgver=0.2
pkgrel=6
groups=('blackarch' 'blackarch-cracker')
pkgdesc='A small tool designed to recover hashed known_hosts fields back to their plain-text equivalents.'
arch=('x86_64' 'aarch64')
url='http://packetstormsecurity.com/files/87003/Known-Host-Cracker-0.2.html'
license=('custom:unknown')
depends=('openssl')
source=("https://dl.packetstormsecurity.net/UNIX/utilities/${pkgname}_$pkgver.tar.gz")
sha512sums=('97d044b3b9dacc001ee224a62c769e387219382ce68ae037c730528e116511fa5873f42f46a635202d694103504dfb591335f604d3fb7d802dc9bc4c0b4181b3')

build() {
  cd $pkgname

  make -f Makefile.gmake
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" AUTHORS CHANGELOG \
    CONCEPT EXAMPLES INSTALL TODO VERSION
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

